package com.wangzd.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义的 Ribbon 负载均衡策略
 *
 * @author wangzd
 * @date 2021/1/22 16:26
 */
@Configuration
public class MyselfRule {

    @Bean
    public IRule myRule() {
        // 随机策略
        return new RandomRule();
    }
}
